package com.sywl.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.PrivilegeDao;
import com.sywl.orm.Privilege;
import com.sywl.service.PrivilegeService;
import com.sywl.util.DataGridModel;

@Service(value="privilegeService")
@Transactional
public class PrivilegeServiceImpl implements PrivilegeService {

	@Resource(name="privilegeDao")
	private PrivilegeDao privilegeDao;

	public void save(Privilege entity) {
		privilegeDao.save(entity);
	}

	public void update(Privilege entity) {
		privilegeDao.update(entity);
	}

	public void delete(Serializable id) {
		privilegeDao.delete(id);
	}

	public Privilege findById(Serializable id) {
		return privilegeDao.findById(id);
	}

	public List<Privilege> getAll() {
		return privilegeDao.getAll();
	}

	public List<Privilege> findByHQL(String hql, Object... params) {
		return privilegeDao.findByHQL(hql, params);
	}

	public Map<String, Object> getPageList(DataGridModel dgm, Privilege entity)
			throws Exception {
		return privilegeDao.getPageList(dgm, entity);
	}
}
